<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设置不透明度</title>
    <style type="text/css">
#boxwrap{
width: 330px;margin: 10px auto;border: solid 1px #ff6666;
}
img:first-child{opacity: 1;}
img:first-child(2){opacity: 0.8;}
img:first-child(3){opacity: 0.6;}
img:first-child(4){opacity: 0.1;}





    </style>
</head>
<body>
    <div id="boxwrap">
        <img src="hong.png" alt="" width="160">
        <img src="hong.png" alt="" width="160">
        <img src="hong.png" alt="" width="160">
        <img src="hong.png" alt="" width="160">



        

    </div>
</body>
</html>